<?
include 'config/config.inc.php';
include '../source/includes/clienti.distributori.class.php';
include '../source/includes/cPHPVersion.class.php';
include '../source/includes/cIniFileReader.class.php';
$tempFile = $_FILES['Filedata']['tmp_name'];
$ext = substr($_FILES['Filedata']['name'], -3);
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] ."/uploads/";
$targetFile =  str_replace('//','/',$targetPath) . "logo.".$ext;
if(file_exists($targetFile)) unlink($targetFile);
move_uploaded_file($tempFile,$targetFile);
$cartella = substr($_REQUEST['folder'], 1);
$rs = lancia_procedura("aggiorna_logo", "'".$cartella."','logo.$ext'");
?>
